//
//  Asset.swift
//  MyVideo
//
//  Created by han on 2021/4/22.
//

import AVFoundation

class Asset {
    var urlAsset: AVURLAsset
    let stream: Stream
    
    init(stream: Stream, urlAsset: AVURLAsset) {
        self.urlAsset = urlAsset
        self.stream = stream
    }
}

extension Asset: Equatable {
    static func == (lhs: Asset, rhs: Asset) -> Bool {
        (lhs.stream == rhs.stream) && (lhs.urlAsset == rhs.urlAsset)
    }
}

// download
extension Asset {
    enum DownloadState: String {
        case downloaded
        case downloading
        case notDownloaded
    }
}

extension Asset {
    struct Keys {
        static let name = "AssetNameKey"
        static let percentDownloaded = "AssetPercentDownloadedKey"
        static let downloadState = "AssetDownloadStateKey"
        static let downloadSelectionDisplayName = "AssetDownloadSelectionDisplayNameKey"
    }
}
